home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Dev / Bgui / include / bgui / bgui_image.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-09  |  15.3 KB  |  351 lines

  1. #ifndef BGUI_IMAGE_H
  2. #define BGUI_IMAGE_H
  3. /*
  4.  * @(#) $Header: /cvsroot/bgui/include/bgui_image.h,v 41.11 2000/05/09 20:01:48 mlemos Exp $
  5.  *
  6.  * $VER: bgui/bgui_image.h 41.10 (25.4.96)
  7.  *
  8.  * Image classes structures and constants.
  9.  *
  10.  * (C) Copyright 1998 Manuel Lemos.
  11.  * (C) Copyright 1996-1997 Ian J. Einman.
  12.  * (C) Copyright 1993-1996 Jaba Development.
  13.  * (C) Copyright 1993-1996 Jan van den Baard.
  14.  * All Rights Reserved.
  15.  *
  16.  * $Log: bgui_image.h,v $
  17.  * Revision 41.11  2000/05/09 20:01:48  mlemos
  18.  * Merged with the branch Manuel_Lemos_fixes.
  19.  *
  20.  * Revision 41.10  1998/02/25 21:13:47  mlemos
  21.  * Bumping to 41.10
  22.  *
  23.  * Revision 1.1  1998/02/25 17:15:50  mlemos
  24.  * Ian sources
  25.  *
  26.  *
  27.  */
  28.  
  29. #ifndef INTUITION_IMAGECLASS_H
  30. #include <intuition/imageclass.h>
  31. #endif /* INTUITION_IMAGECLASS_H */
  32.  
  33. /*****************************************************************************
  34.  *
  35.  *      "frameclass" - BOOPSI framing image.
  36.  *
  37.  *      Tags: 1 - 80    Methods: 21 - 40
  38.  */
  39. #define FRM_TAGSTART                    (BGUI_TB+1)
  40. #define FRM_Type                        (BGUI_TB+1)     /* ISG-- */
  41. #define FRM_CustomHook                  (BGUI_TB+2)     /* ISG-- */
  42. #define FRM_BackFillHook                (BGUI_TB+3)     /* ISG-- */
  43. #define FRM_Title                       (BGUI_TB+4)     /* ISG-- */
  44. #define FRM_TextAttr                    (BGUI_TB+5)     /* ISG-- */
  45. #define FRM_Flags                       (BGUI_TB+6)     /* ISG-- */
  46. #define FRM_FrameWidth                  (BGUI_TB+7)     /* ISG-- */
  47. #define FRM_FrameHeight                 (BGUI_TB+8)     /* ISG-- */
  48. #define FRM_BackFill                    (BGUI_TB+9)     /* ISG-- */
  49. #define FRM_EdgesOnly                   (BGUI_TB+10)    /* ISG-- */
  50. #define FRM_Recessed                    (BGUI_TB+11)    /* ISG-- */
  51. #define FRM_CenterTitle                 (BGUI_TB+12)    /* ISG-- */
  52. #define FRM_HighlightTitle              (BGUI_TB+13)    /* ISG-- */
  53. #define FRM_ThinFrame                   (BGUI_TB+14)    /* ISG-- */
  54. #define FRM_BackPen                     (BGUI_TB+15)    /* ISG-- */  /* V39 */
  55. #define FRM_SelectedBackPen             (BGUI_TB+16)    /* ISG-- */  /* V39 */
  56. #define FRM_BackDriPen                  (BGUI_TB+17)    /* ISG-- */  /* V39 */
  57. #define FRM_SelectedBackDriPen          (BGUI_TB+18)    /* ISG-- */  /* V39 */
  58. #define FRM_TitleLeft                   (BGUI_TB+19)    /* ISG-- */  /* V40 */
  59. #define FRM_TitleRight                  (BGUI_TB+20)    /* ISG-- */  /* V40 */
  60. #define FRM_BackRasterPen               (BGUI_TB+21)    /* ISG-- */  /* V41 */
  61. #define FRM_BackRasterDriPen            (BGUI_TB+22)    /* ISG-- */  /* V41 */
  62. #define FRM_SelectedBackRasterPen       (BGUI_TB+23)    /* ISG-- */  /* V41 */
  63. #define FRM_SelectedBackRasterDriPen    (BGUI_TB+24)    /* ISG-- */  /* V41 */
  64. #define FRM_Template                    (BGUI_TB+25)    /* IS--- */  /* V41 */
  65. #define FRM_TitleID                     (BGUI_TB+26)    /* ISG-- */  /* V41 */
  66. #define FRM_FillPattern                 (BGUI_TB+27)    /* ISG-- */  /* V41 */
  67. #define FRM_SelectedFillPattern         (BGUI_TB+28)    /* ISG-- */  /* V41 */
  68. #define FRM_OuterOffsetLeft             (BGUI_TB+31)    /* ISG-- */  /* V41 */
  69. #define FRM_OuterOffsetRight            (BGUI_TB+32)    /* ISG-- */  /* V41 */
  70. #define FRM_OuterOffsetTop              (BGUI_TB+33)    /* ISG-- */  /* V41 */
  71. #define FRM_OuterOffsetBottom           (BGUI_TB+34)    /* ISG-- */  /* V41 */
  72. #define FRM_InnerOffsetLeft             (BGUI_TB+35)    /* ISG-- */  /* V41 */
  73. #define FRM_InnerOffsetRight            (BGUI_TB+36)    /* ISG-- */  /* V41 */
  74. #define FRM_InnerOffsetTop              (BGUI_TB+37)    /* ISG-- */  /* V41 */
  75. #define FRM_InnerOffsetBottom           (BGUI_TB+38)    /* ISG-- */  /* V41 */
  76. #define FRM_TAGDONE                     (BGUI_TB+80)
  77.  
  78. /* Back fill types */
  79. #define STANDARD_FILL           0
  80. #define SHINE_RASTER            1
  81. #define SHADOW_RASTER           2
  82. #define SHINE_SHADOW_RASTER     3
  83. #define FILL_RASTER             4
  84. #define SHINE_FILL_RASTER       5
  85. #define SHADOW_FILL_RASTER      6
  86. #define SHINE_BLOCK             7
  87. #define SHADOW_BLOCK            8
  88. #define FILL_BLOCK              9
  89.  
  90. /* Flags */
  91. #define FRF_EDGES_ONLY          (1<<0)
  92. #define FRF_RECESSED            (1<<1)
  93. #define FRF_CENTER_TITLE        (1<<2)
  94. #define FRF_HIGHLIGHT_TITLE     (1<<3)
  95. #define FRF_THIN_FRAME          (1<<4)
  96. #define FRF_TITLE_LEFT          (1<<5)  /* V40 */
  97. #define FRF_TITLE_RIGHT         (1<<6)  /* V40 */
  98.  
  99. #define FRB_EDGES_ONLY          0
  100. #define FRB_RECESSED            1
  101. #define FRB_CENTER_TITLE        2
  102. #define FRB_HIGHLIGHT_TITLE     3
  103. #define FRB_THIN_FRAME          4
  104. #define FRB_TITLE_LEFT          5       /* V40 */
  105. #define FRB_TITLE_RIGHT         6       /* V40 */
  106.  
  107. /* Frame types */
  108. #define FRTYPE_CUSTOM           0
  109. #define FRTYPE_BUTTON           1
  110. #define FRTYPE_RIDGE            2
  111. #define FRTYPE_DROPBOX          3
  112. #define FRTYPE_NEXT             4
  113. #define FRTYPE_RADIOBUTTON      5
  114. #define FRTYPE_XEN_BUTTON       6
  115. #define FRTYPE_TAB_ABOVE        7       /* V40 */
  116. #define FRTYPE_TAB_BELOW        8       /* V40 */
  117. #define FRTYPE_BORDER           9       /* V40 */
  118. #define FRTYPE_NONE             10      /* V40 */
  119. #define FRTYPE_FUZZ_BUTTON      11      /* V41.1 */
  120. #define FRTYPE_FUZZ_RIDGE       12      /* V41.2 */
  121. #define FRTYPE_TAB_TOP          13      /* V41.8 */
  122. #define FRTYPE_TAB_BOTTOM       14
  123. #define FRTYPE_TAB_LEFT         15
  124. #define FRTYPE_TAB_RIGHT        16
  125.  
  126. #define FRTYPE_DEFAULT          (~0)    /* V41.8 */
  127.  
  128. #define FRAMEM_BACKFILL                 (BGUI_MB+21)
  129.  
  130. /* Backfill a specific rectangle with the backfill hook. */
  131. struct fmBackfill {
  132.         ULONG             MethodID;             /* FRM_RENDER                     */
  133.         struct BaseInfo  *fmb_BInfo;            /* BaseInfo ready for rendering   */
  134.         struct Rectangle *fmb_Bounds;           /* Rendering bounds.              */
  135.         ULONG             fmb_State;            /* See "intuition/imageclass.h"   */
  136. };
  137.  
  138. /*
  139.  *      FRM_RENDER:
  140.  *
  141.  *      The message packet sent to both the FRM_CustomHook
  142.  *      and FRM_BackFillHook routines. Note that this
  143.  *      structure is READ-ONLY!
  144.  *
  145.  *      The hook is called as follows:
  146.  *
  147.  *              rc = hookFunc( REG(A0) struct Hook         *hook,
  148.  *                             REG(A2) Object              *image_object,
  149.  *                             REG(A1) struct FrameDrawMsg *fdraw );
  150.  */
  151. #define FRM_RENDER              (1L) /* Render yourself           */
  152.  
  153. struct FrameDrawMsg
  154. {
  155.         ULONG             fdm_MethodID;         /* FRM_RENDER                     */
  156.         struct RastPort  *fdm_RPort;            /* RastPort ready for rendering   */
  157.         struct DrawInfo  *fdm_DrawInfo;         /* All you need to render         */
  158.         struct Rectangle *fdm_Bounds;           /* Rendering bounds.              */
  159.         UWORD             fdm_State;            /* See "intuition/imageclass.h"   */
  160.         /*
  161.          * The following fields are only defined under V41.
  162.          */
  163.         UBYTE             fdm_Horizontal;       /* Horizontal thickness           */
  164.         UBYTE             fdm_Vertical;         /* Vertical thickness             */
  165. };
  166.  
  167. /*
  168.  *      FRM_THICKNESS:
  169.  *
  170.  *      The message packet sent to the FRM_Custom hook.
  171.  *
  172.  *      The hook is called as follows:
  173.  *
  174.  *      rc = hookFunc( REG(A0) struct Hook              *hook,
  175.  *                     REG(A2) Object                   *image_object,
  176.  *                     REG(A1) struct ThicknessMsg      *thick );
  177.  */
  178. #define FRM_THICKNESS           (2L) /* Give the default frame thickness. */
  179.  
  180. struct ThicknessMsg {
  181.         ULONG            tm_MethodID;           /* FRM_THICKNESS                  */
  182.         struct {
  183.                 UBYTE   *Horizontal;            /* Storage for horizontal         */
  184.                 UBYTE   *Vertical;              /* Storage for vertical   */
  185.         }                tm_Thickness;
  186.         BOOL             tm_Thin;               /* Added in V38!                  */
  187. };
  188.  
  189. /* Possible hook return codes. */
  190. #define FRC_OK                  0 /* OK       */
  191. #define FRC_UNKNOWN             1 /* Unknown method */
  192.  
  193.  
  194. /*****************************************************************************
  195.  *
  196.  *      "labelclass" - BOOPSI labeling image.
  197.  *
  198.  *      Tags: 81 - 160          Methods: 1 - 20
  199.  */
  200.  
  201. #define LAB_TAGSTART                    (BGUI_TB+81)
  202. #define LAB_TextAttr                    (BGUI_TB+81)    /* ISG-- */
  203. #define LAB_Style                       (BGUI_TB+82)    /* ISG-- */
  204. #define LAB_Underscore                  (BGUI_TB+83)    /* ISG-- */
  205. #define LAB_Place                       (BGUI_TB+84)    /* ISG-- */
  206. #define LAB_Label                       (BGUI_TB+85)    /* ISG-- */
  207. #define LAB_Flags                       (BGUI_TB+86)    /* ISG-- */
  208. #define LAB_Highlight                   (BGUI_TB+87)    /* ISG-- */
  209. #define LAB_HighUScore                  (BGUI_TB+88)    /* ISG-- */
  210. #define LAB_Pen                         (BGUI_TB+89)    /* ISG-- */
  211. #define LAB_SelectedPen                 (BGUI_TB+90)    /* ISG-- */
  212. #define LAB_DriPen                      (BGUI_TB+91)    /* ISG-- */
  213. #define LAB_SelectedDriPen              (BGUI_TB+92)    /* ISG-- */
  214. #define LAB_LabelID                     (BGUI_TB+93)    /* ISG-- */     /* V41 */
  215. #define LAB_Template                    (BGUI_TB+94)    /* IS--- */     /* V41 */
  216. #define LAB_NoPlaceIn                   (BGUI_TB+95)    /* ISG-- */     /* V41.7 */
  217. #define LAB_SelectedStyle               (BGUI_TB+96)    /* ISG-- */     /* V41.7 */
  218. #define LAB_FlipX                       (BGUI_TB+97)    /* ISG-- */     /* V41.7 */
  219. #define LAB_FlipY                       (BGUI_TB+98)    /* ISG-- */     /* V41.7 */
  220. #define LAB_FlipXY                      (BGUI_TB+99)    /* ISG-- */     /* V41.7 */
  221. #define LAB_TAGDONE                     (BGUI_TB+160)
  222.  
  223. /* Flags */
  224. #define LABF_HIGHLIGHT          (1<<0)  /* Highlight label        */
  225. #define LABF_HIGH_USCORE        (1<<1)  /* Highlight underscoring */
  226. #define LABF_FLIP_X             (1<<2)  /* Flip across x axis     */
  227. #define LABF_FLIP_Y             (1<<3)  /* Flip across y axis     */
  228. #define LABF_FLIP_XY            (1<<4)  /* Flip across x = y      */
  229.  
  230. #define LABB_HIGHLIGHT          0       /* Highlight label        */
  231. #define LABB_HIGH_USCORE        1       /* Highlight underscoring */
  232. #define LABB_FLIP_X             2       /* Flip across x axis     */
  233. #define LABB_FLIP_Y             3       /* Flip across y axis     */
  234. #define LABB_FLIP_XY            4       /* Flip across x = y      */
  235.  
  236. /* Label placement */
  237. #define PLACE_IN                0
  238. #define PLACE_LEFT              1
  239. #define PLACE_RIGHT             2
  240. #define PLACE_ABOVE             3
  241. #define PLACE_BELOW             4
  242.  
  243. /* New methods */
  244. /*
  245.  *      The IM_EXTENT method is used to find out how many
  246.  *      pixels the label extents the relative hitbox in
  247.  *      either direction. Normally this method is called
  248.  *      by the baseclass.
  249.  */
  250. #define IM_EXTENT                       (BGUI_MB+1)
  251.  
  252. struct impExtent {
  253.         ULONG                   MethodID;       /* IM_EXTENT                */
  254.         struct RastPort        *impe_RPort;     /* RastPort                 */
  255.         struct IBox            *impe_Extent;    /* Storage for extentions.  */
  256.         struct {
  257.                 UWORD          *Width;          /* Storage width in pixels  */
  258.                 UWORD          *Height;         /* Storage height in pixels */
  259.         }                       impe_LabelSize;
  260.         UWORD                   impe_Flags;     /* See below.               */
  261. };
  262.  
  263. #define EXTF_MAXIMUM            (1<<0)          /* Request maximum extensions. */
  264.  
  265.  
  266. /*****************************************************************************
  267.  *
  268.  *      "vectorclass" - BOOPSI scalable vector image.
  269.  *
  270.  *      Tags: 161 - 240
  271.  *
  272.  *      Based on an idea found in the ObjectiveGadTools.library
  273.  *      by Davide Massarenti.
  274.  */
  275. #define VIT_TAGSTART                    (BGUI_TB+161)
  276. #define VIT_VectorArray                 (BGUI_TB+161)   /* ISG-- */
  277. #define VIT_BuiltIn                     (BGUI_TB+162)   /* ISG-- */
  278. #define VIT_Pen                         (BGUI_TB+163)   /* ISG-- */
  279. #define VIT_DriPen                      (BGUI_TB+164)   /* ISG-- */
  280. #define VIT_MinWidth                    (BGUI_TB+165)   /* --G-- */  /* V41.8 */
  281. #define VIT_MinHeight                   (BGUI_TB+166)   /* --G-- */
  282. #define VIT_TAGDONE                     (BGUI_TB+200)
  283.  
  284. /*
  285.  *      Command structure which can contain
  286.  *      coordinates, data and command flags.
  287.  */
  288. struct VectorItem {
  289.         WORD                    vi_x;           /* X coordinate or data */
  290.         WORD                    vi_y;           /* Y coordinate         */
  291.         ULONG                   vi_Flags;       /* See below            */
  292. };
  293.  
  294. /* Flags */
  295. #define VIF_MOVE                (1<<0)  /* Move to vc_x, vc_y                */
  296. #define VIF_DRAW                (1<<1)  /* Draw to vc_x, vc_y                */
  297. #define VIF_AREASTART           (1<<2)  /* Start AreaFill at vc_x, vc_y      */
  298. #define VIF_AREAEND             (1<<3)  /* End AreaFill at vc_x, vc_y        */
  299. #define VIF_XRELRIGHT           (1<<4)  /* vc_x relative to right edge       */
  300. #define VIF_YRELBOTTOM          (1<<5)  /* vc_y relative to bottom edge      */
  301. #define VIF_SHADOWPEN           (1<<6)  /* switch to SHADOWPEN, Move/Draw    */
  302. #define VIF_SHINEPEN            (1<<7)  /* switch to SHINEPEN, Move/Draw     */
  303. #define VIF_FILLPEN             (1<<8)  /* switch to FILLPEN, Move/Draw      */
  304. #define VIF_TEXTPEN             (1<<9)  /* switch to TEXTPEN, Move/Draw      */
  305. #define VIF_COLOR               (1<<10) /* switch to color(s) in vc_x (+y)   */
  306. #define VIF_LASTITEM            (1<<11) /* last element of the element list  */
  307. #define VIF_SCALE               (1<<12) /* X & Y are design width & height   */
  308. #define VIF_DRIPEN              (1<<13) /* switch to dripen(s) in vc_x (+y)  */
  309. #define VIF_AOLPEN              (1<<14) /* set area outline pen vc_x         */
  310. #define VIF_AOLDRIPEN           (1<<15) /* set area outline dripen vc_x      */
  311. #define VIF_ENDOPEN             (1<<16) /* end area outline pen              */
  312. #define VIF_MINSIZE             (1<<17) /* X & Y are minimum size            */  /* V41.8 */
  313. #define VIF_LINEPATTERN         (1<<18) /* Use line pattern in vc_x          */
  314. #define VIF_BPEN                (1<<19) /* Interpret vc_y as bpen            */
  315. #define VIF_DRAWMODE            (1<<20) /* Draw mode                         */
  316.  
  317. /* Built-in images. */
  318. #define BUILTIN_GETPATH         1
  319. #define BUILTIN_GETFILE         2
  320. #define BUILTIN_CHECKMARK       3
  321. #define BUILTIN_POPUP           4
  322. #define BUILTIN_ARROW_UP        5
  323. #define BUILTIN_ARROW_DOWN      6
  324. #define BUILTIN_ARROW_LEFT      7
  325. #define BUILTIN_ARROW_RIGHT     8
  326. #define BUILTIN_CYCLE           9       /* V41 */
  327. #define BUILTIN_CYCLE2          10      /* V41 */
  328. #define BUILTIN_RADIOBUTTON     11      /* V41 */
  329. #define BUILTIN_GETFONT         12      /* V41.9 */
  330. #define BUILTIN_GETSCREEN       13      /* V41.9 */
  331.  
  332. /* Design width and heights of the built-in images. */
  333. #define GETPATH_WIDTH           20
  334. #define GETPATH_HEIGHT          14
  335. #define GETFILE_WIDTH           20
  336. #define GETFILE_HEIGHT          14
  337. #define CHECKMARK_WIDTH         24
  338. #define CHECKMARK_HEIGHT        11
  339. #define POPUP_WIDTH             14
  340. #define POPUP_HEIGHT            12
  341. #define ARROW_UP_WIDTH          16
  342. #define ARROW_UP_HEIGHT         9
  343. #define ARROW_DOWN_WIDTH        16
  344. #define ARROW_DOWN_HEIGHT       9
  345. #define ARROW_LEFT_WIDTH        10
  346. #define ARROW_LEFT_HEIGHT       12
  347. #define ARROW_RIGHT_WIDTH       10
  348. #define ARROW_RIGHT_HEIGHT      12
  349.  
  350. #endif /* BGUI_IMAGE_H */
  351.